package com.hm.manage.controller;

import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hm.common.annotation.Log;
import com.hm.common.core.controller.BaseController;
import com.hm.common.core.domain.AjaxResult;
import com.hm.common.enums.BusinessType;
import com.hm.manage.domain.Xxxtsimp;
import com.hm.manage.service.IXxxtsimpService;
import com.hm.common.utils.poi.ExcelUtil;
import com.hm.common.core.page.TableDataInfo;

/**
 * 信息系统基础信息Controller
 * 
 * @author hm
 * @date 2025-04-29
 */
@RestController
@RequestMapping("/manage/xxxtsimp")
public class XxxtsimpController extends BaseController
{
    @Autowired
    private IXxxtsimpService xxxtsimpService;

    /**
     * 查询信息系统基础信息列表
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:list')")
    @GetMapping("/list")
    public TableDataInfo list(Xxxtsimp xxxtsimp)
    {
        startPage();
        List<Xxxtsimp> list = xxxtsimpService.selectXxxtsimpList(xxxtsimp);
        return getDataTable(list);
    }

    /**
     * 导出信息系统基础信息列表
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:export')")
    @Log(title = "信息系统基础信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Xxxtsimp xxxtsimp)
    {
        List<Xxxtsimp> list = xxxtsimpService.selectXxxtsimpList(xxxtsimp);
        ExcelUtil<Xxxtsimp> util = new ExcelUtil<Xxxtsimp>(Xxxtsimp.class);
        util.exportExcel(response, list, "信息系统基础信息数据");
    }

    /**
     * 获取信息系统基础信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(xxxtsimpService.selectXxxtsimpById(id));
    }

    /**
     * 新增信息系统基础信息
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:add')")
    @Log(title = "信息系统基础信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Xxxtsimp xxxtsimp)
    {
        return toAjax(xxxtsimpService.insertXxxtsimp(xxxtsimp));
    }

    /**
     * 修改信息系统基础信息
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:edit')")
    @Log(title = "信息系统基础信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Xxxtsimp xxxtsimp)
    {
        return toAjax(xxxtsimpService.updateXxxtsimp(xxxtsimp));
    }

    /**
     * 删除信息系统基础信息
     */
    @PreAuthorize("@ss.hasPermi('manage:xxxtsimp:remove')")
    @Log(title = "信息系统基础信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(xxxtsimpService.deleteXxxtsimpByIds(ids));
    }
}
